<template>
  <div class="my-header">
    <van-nav-bar :left-text="leftText" :title="title" left-arrow @click-left="goBack">
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: "myHeader",
  props: {
    leftText: {
      type: String,
      default: ""
    },
    title: {
      type: String,
      default: ""
    },
    routerName: {
      type: String,
      default: "/"
    }
  },
  data() {
    return {};
  },
  methods: {
    goBack() {
      this.$router.push({ name: this.routerName });
    }
  }
};
</script>
